package com.moss.common.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * 通用常量参数
 */
public class Constants {


    //过期时间7200s 2小时
    public static final int TOKEN_EXPIRATION = 7200;


    /** 菜单类型（目录） */
    public static final String TYPE_DIR = "M";

    /** 菜单类型（菜单） */
    public static final String TYPE_MENU = "C";

    /** 菜单类型（按钮） */
    public static final String TYPE_BUTTON = "F";

    /** 是否菜单外链（否） */
    public static final Integer NO_FRAME = 0;

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * www主域
     */
    public static final String WWW = "www.";

    /** Layout组件标识 */
    public final static String LAYOUT = "Layout";

    /** ParentView组件标识 */
    public final static String PARENT_VIEW = "ParentView";

    /** InnerLink组件标识 */
    public final static String INNER_LINK = "InnerLink";

    /** 标记admin，为admin标识的角色则为管理员，不受权限约束，慎重绑定账号*/
    public static final String ADMIN_KEY = "admin";
    /**
     * 顶级树Id
     */
    public static final String TREE_ROOT = "0";
    /**
     * 树的ID串分隔符
     */
    public static final String TREE_LEAF_Y = "y";
    /** 多个参数的默认分隔符*/
    public static final String PARAM_DEFAULT_SPLIT = ",";
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * 日志操作类型
     */
    public enum OpType {
        login, insert, delete, update, select, logout
    }

    /**
     * 树的ID串分隔符
     */
    public static final String TREE_IDS_SPLIT_CHART = "/";

    /**
     * 树的ID串分隔符
     */
    public static final String TREE_LEAF_N = "n";

    public static final Map<String,String> SAMPLE_PREFIX;

    public static final String SELF_SAMPLE = "self";

    public static final String TASK_SAMPLE = "task";

    public static final String DELIVER_SAMPLE = "deliver";

    public static final String FJ_SAMPLE = "fj";

    static {
        SAMPLE_PREFIX = new HashMap<>();
        SAMPLE_PREFIX.put(SELF_SAMPLE, "CY");
        SAMPLE_PREFIX.put(TASK_SAMPLE, "TCY");
        SAMPLE_PREFIX.put(DELIVER_SAMPLE, "SCY");
        SAMPLE_PREFIX.put(FJ_SAMPLE, "FJCY");
    }

    public static final String DASHBOARD_DAY = "day";

    public static final String DASHBOARD_WEEK = "week";

    public static final String DASHBOARD_MONTH = "month";

    public static final String DASHBOARD_HALF_YEAR = "halfYear";

    public static final String DASHBOARD_YEAR = "year";
}
